#ifndef _EPD_PORT_H_
#define _EPD_PORT_H_

#include <stdint.h>
#include "driver/spi_master.h"
#include "esp_err.h"


typedef struct
{
    uint8_t busy_io_num;
    uint8_t reset_io_num;
    uint8_t cs_io_num;
    uint8_t dc_io_num;
    uint8_t sck_io_num;
    uint8_t sda_io_num;
    spi_host_device_t host_id;
    int clock_speed_hz;
    int max_transfer_sz;
    int queue_size;
    spi_device_handle_t dev_handle;
} epd_port_t;

esp_err_t epd_port_init(epd_port_t *port);
esp_err_t epd_port_write(epd_port_t *port, uint8_t *pdata, size_t len, uint8_t is_data);
int epd_port_is_busy(epd_port_t *port);
esp_err_t epd_port_set_reset(epd_port_t *port, uint8_t level);

#endif /* _EPD_PORT_H_ */